//2009/08/19 18:43:54
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class TemperatureScales
{
public:
    double convert(int f1, int b1, int f2, int b2, int t)
    {
		double ret = (double) ((1.*b2-1.*f2) * (1.*t-1.*f1) / (1.*b1-1.*f1) + 1.*f2);
		return ret;
    }
};
